#include "demowindow.h"
#include "ui_demowindow.h"
//#include "leddialog.h"


DemoWindow::DemoWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::DemoWindow)
{
    ui->setupUi(this);

    this->f_leddialog = new LedDialog;
    this->f_relaydialog = new relayDialog;
    this->f_irdialog = new IRDialog;
    this->f_comdialog = new ComDialog;
    this->f_sensordialog = new SensorDialog;
    this->f_networkdialog = new NetworkDialog;

    ui->stackedWidget_main->addWidget(this->f_leddialog);
    ui->stackedWidget_main->addWidget(this->f_relaydialog);
    ui->stackedWidget_main->addWidget(this->f_irdialog);
    ui->stackedWidget_main->addWidget(this->f_comdialog);
    ui->stackedWidget_main->addWidget(this->f_sensordialog);
    ui->stackedWidget_main->addWidget(this->f_networkdialog);
}

DemoWindow::~DemoWindow()
{
    delete ui;
}

void DemoWindow::on_pushButton_led_clicked()
{
    //ui->stackedWidget_main->setCurrentIndex(1);
    ui->stackedWidget_main->setCurrentWidget(this->f_leddialog);
}

void DemoWindow::on_pushButton_relay_clicked()
{
    ui->stackedWidget_main->setCurrentWidget(this->f_relaydialog);
}

void DemoWindow::on_pushButton_5_clicked()
{
    ui->stackedWidget_main->setCurrentWidget(this->f_irdialog);
}

void DemoWindow::on_pushButton_2_clicked()
{
    ui->stackedWidget_main->setCurrentWidget(this->f_comdialog);
}

void DemoWindow::on_pushButton_sensor_clicked()
{
    ui->stackedWidget_main->setCurrentWidget(this->f_sensordialog);
}

void DemoWindow::on_pushButton_network_clicked()
{
    ui->stackedWidget_main->setCurrentWidget(this->f_networkdialog);
}
